﻿
Option Strict On

Imports System.Text
Imports osi.root.constants
Imports osi.root.connector
Imports osi.root.utils
Imports osi.root.formation
Imports osi.root.delegates

Public Class bytes_conversion(Of T)
    Private Sub New()
    End Sub

    Public Shared Sub assert_bind(ByVal f As Func(Of Byte(), T))
        bytes_conversion.assert_bind(f)
    End Sub

    Public Shared Function bind(ByVal f As Func(Of Byte(), T)) As Boolean
        Return bytes_conversion.bind(f)
    End Function

    Public Shared Sub assert_bind(ByVal f As _do_val_ref(Of Byte(), T, Boolean))
        bytes_conversion.assert_bind(f)
    End Sub

    Public Shared Function bind(ByVal f As _do_val_ref(Of Byte(), T, Boolean)) As Boolean
        Return bytes_conversion.bind(f)
    End Function

    Public Shared Sub assert_bind(ByVal f As _do_val_ref_ref(Of Byte(), T, UInt32, Boolean))
        bytes_conversion.assert_bind(f)
    End Sub

    Public Shared Function bind(ByVal f As _do_val_ref_ref(Of Byte(), T, UInt32, Boolean)) As Boolean
        Return bytes_conversion.bind(f)
    End Function

    Public Shared Sub assert_bind(ByVal f As Func(Of T, Byte()))
        bytes_conversion.assert_bind(f)
    End Sub

    Public Shared Function bind(ByVal f As Func(Of T, Byte())) As Boolean
        Return bytes_conversion.bind(f)
    End Function

    Public Shared Sub assert_bind(ByVal f As _do_val_ref(Of T, Byte(), Boolean))
        bytes_conversion.assert_bind(f)
    End Sub

    Public Shared Function bind(ByVal f As _do_val_ref(Of T, Byte(), Boolean)) As Boolean
        Return bytes_conversion.bind(f)
    End Function

    Public Shared Sub assert_bind(ByVal f As Func(Of T, Byte(), Boolean))
        bytes_conversion.assert_bind(f)
    End Sub

    Public Shared Function bind(ByVal f As Func(Of T, Byte(), Boolean)) As Boolean
        Return bytes_conversion.bind(f)
    End Function

    Public Shared Sub assert_bind(ByVal f As _do_val_val_ref(Of T, Byte(), UInt32, Boolean))
        bytes_conversion.assert_bind(f)
    End Sub

    Public Shared Function bind(ByVal f As _do_val_val_ref(Of T, Byte(), UInt32, Boolean)) As Boolean
        Return bytes_conversion.bind(f)
    End Function
End Class

Public Class bytes_conversion
    Private Sub New()
    End Sub

    Public Shared Sub assert_bind(Of T)(ByVal f As Func(Of Byte(), T))
        assert(bind(f))
    End Sub

    Public Shared Function bind(Of T)(ByVal f As Func(Of Byte(), T)) As Boolean
        If f Is Nothing Then
            Return False
        Else
            binder(Of Func(Of Byte(), T), bytes_conversion_binder_protector).set_global(f)
            Return True
        End If
    End Function

    Public Shared Sub assert_bind(Of T)(ByVal f As _do_val_ref(Of Byte(), T, Boolean))
        assert(bind(f))
    End Sub

    Public Shared Function bind(Of T)(ByVal f As _do_val_ref(Of Byte(), T, Boolean)) As Boolean
        If f Is Nothing Then
            Return False
        Else
            binder(Of _do_val_ref(Of Byte(), T, Boolean), bytes_conversion_binder_protector).set_global(f)
            Return True
        End If
    End Function

    Public Shared Sub assert_bind(Of T)(ByVal f As _do_val_ref_ref(Of Byte(), T, UInt32, Boolean))
        assert(bind(f))
    End Sub

    Public Shared Function bind(Of T)(ByVal f As _do_val_ref_ref(Of Byte(), T, UInt32, Boolean)) As Boolean
        If f Is Nothing Then
            Return False
        Else
            binder(Of _do_val_ref_ref(Of Byte(), T, UInt32, Boolean), bytes_conversion_binder_protector).set_global(f)
            Return True
        End If
    End Function

    Public Shared Sub assert_bind(Of T)(ByVal f As Func(Of T, Byte()))
        assert(bind(f))
    End Sub

    Public Shared Function bind(Of T)(ByVal f As Func(Of T, Byte())) As Boolean
        If f Is Nothing Then
            Return False
        Else
            binder(Of Func(Of T, Byte()), bytes_conversion_binder_protector).set_global(f)
            Return True
        End If
    End Function

    Public Shared Sub assert_bind(Of T)(ByVal f As _do_val_ref(Of T, Byte(), Boolean))
        assert(bind(f))
    End Sub

    Public Shared Function bind(Of T)(ByVal f As _do_val_ref(Of T, Byte(), Boolean)) As Boolean
        If f Is Nothing Then
            Return False
        Else
            binder(Of _do_val_ref(Of T, Byte(), Boolean), bytes_conversion_binder_protector).set_global(f)
            Return True
        End If
    End Function

    Public Shared Sub assert_bind(Of T)(ByVal f As Func(Of T, Byte(), Boolean))
        assert(bind(f))
    End Sub

    Public Shared Function bind(Of T)(ByVal f As Func(Of T, Byte(), Boolean)) As Boolean
        If f Is Nothing Then
            Return False
        Else
            binder(Of Func(Of T, Byte(), Boolean), bytes_conversion_binder_protector).set_global(f)
            Return True
        End If
    End Function

    Public Shared Sub assert_bind(Of T)(ByVal f As _do_val_val_ref(Of T, Byte(), UInt32, Boolean))
        assert(bind(f))
    End Sub

    Public Shared Function bind(Of T)(ByVal f As _do_val_val_ref(Of T, Byte(), UInt32, Boolean)) As Boolean
        If f Is Nothing Then
            Return False
        Else
            binder(Of _do_val_val_ref(Of T, Byte(), UInt32, Boolean), bytes_conversion_binder_protector).set_global(f)
            Return True
        End If
    End Function
End Class

Public Module _binder
    Public Sub bind_bytes_conversion(Of T)(ByVal f1 As Func(Of Byte(), T),
                                           ByVal f2 As _do_val_ref(Of Byte(), T, Boolean),
                                           ByVal f3 As _do_val_ref_ref(Of Byte(), T, UInt32, Boolean),
                                           ByVal t1 As Func(Of T, Byte()),
                                           ByVal t2 As _do_val_ref(Of T, Byte(), Boolean),
                                           ByVal t3 As Func(Of T, Byte(), Boolean),
                                           ByVal t4 As _do_val_val_ref(Of T, Byte(), UInt32, Boolean))
        If f2 Is Nothing AndAlso Not f3 Is Nothing Then
            f2 = Function(i() As Byte, ByRef o As T) As Boolean
                     Return f3(i, o, uint32_0)
                 End Function
        End If
        If f1 Is Nothing AndAlso Not f2 Is Nothing Then
            f1 = Function(i() As Byte) As T
                     Dim o As T = Nothing
                     Return If(f2(i, o), o, Nothing)
                 End Function
        End If
        If Not f1 Is Nothing Then
            bytes_conversion.assert_bind(f1)
        End If
        If Not f2 Is Nothing Then
            bytes_conversion.assert_bind(f2)
        End If
        If Not f3 Is Nothing Then
            bytes_conversion.assert_bind(f3)
        End If

        If t3 Is Nothing AndAlso Not t4 Is Nothing Then
            t3 = Function(i As T, o() As Byte) As Boolean
                     Return t4(i, o, uint32_0)
                 End Function
        End If
        If t1 Is Nothing AndAlso Not t2 Is Nothing Then
            t1 = Function(i As T) As Byte()
                     Dim o() As Byte = Nothing
                     Return If(t2(i, o), o, Nothing)
                 End Function
        End If
        If Not t1 Is Nothing Then
            bytes_conversion.assert_bind(t1)
        End If
        If Not t2 Is Nothing Then
            bytes_conversion.assert_bind(t2)
        End If
        If Not t3 Is Nothing Then
            bytes_conversion.assert_bind(t3)
        End If
        If Not t4 Is Nothing Then
            bytes_conversion.assert_bind(t4)
        End If
    End Sub

    Public Sub bind_sbyte_bytes_conversion(Of T)()
        bind_bytes_conversion(Of T)(Function(i() As Byte) As T
                                        Return cast(Of T)(_bytes_others.to_sbyte(i))
                                    End Function,
                                    Function(i() As Byte, ByRef o As T) As Boolean
                                        Dim v As SByte = 0
                                        Return entire_bytes_sbyte(i, v) AndAlso
                                               cast(Of T)(v, o)
                                    End Function,
                                    Function(i() As Byte, ByRef o As T, ByRef offset As UInt32) As Boolean
                                        Dim v As SByte = 0
                                        Return bytes_sbyte(i, v, offset) AndAlso
                                               cast(Of T)(v, o)
                                    End Function,
                                    Function(i As T) As Byte()
                                        Return _others_bytes.to_bytes(cast(Of SByte)(i))
                                    End Function,
                                    Function(i As T, ByRef o() As Byte) As Boolean
                                        Dim v As SByte = 0
                                        Return cast(Of SByte)(i, v) AndAlso
                                               eva(o, sbyte_bytes(v))
                                    End Function,
                                    Function(i As T, o() As Byte) As Boolean
                                        Dim v As SByte = 0
                                        Return cast(Of SByte)(i, v) AndAlso
                                               sbyte_bytes(v, o)
                                    End Function,
                                    Function(i As T, o() As Byte, ByRef offset As UInt32) As Boolean
                                        Dim v As SByte = 0
                                        Return cast(Of SByte)(i, v) AndAlso
                                               sbyte_bytes(v, o, offset)
                                    End Function)
    End Sub

    Public Sub bind_bytes_vector_T_conversion(Of T)()
        bind_bytes_conversion(Of vector(Of T))(Function(i() As Byte) As vector(Of T)
                                                   Dim v As vector(Of Byte()) = Nothing
                                                   Dim o As vector(Of T) = Nothing
                                                   If i.entire_bytes_vector_bytes(v) AndAlso
                                                      v.from_vector_bytes(o) Then
                                                       Return o
                                                   Else
                                                       Return Nothing
                                                   End If
                                               End Function,
                                               Function(i() As Byte, ByRef o As vector(Of T)) As Boolean
                                                   Dim v As vector(Of Byte()) = Nothing
                                                   Return i.entire_bytes_vector_bytes(v) AndAlso
                                                          v.from_vector_bytes(o)
                                               End Function,
                                               Function(i() As Byte,
                                                        ByRef o As vector(Of T),
                                                        ByRef offset As UInt32) As Boolean
                                                   Dim v As vector(Of Byte()) = Nothing
                                                   Return i.bytes_vector_bytes(v, offset) AndAlso
                                                          v.from_vector_bytes(o)
                                               End Function,
                                               Function(i As vector(Of T)) As Byte()
                                                   Dim v As vector(Of Byte()) = Nothing
                                                   Dim o() As Byte = Nothing
                                                   If i.to_vector_bytes(v) AndAlso
                                                      v.vector_bytes_bytes_ref(o) Then
                                                       Return o
                                                   Else
                                                       Return Nothing
                                                   End If
                                               End Function,
                                               Function(i As vector(Of T), ByRef o() As Byte) As Boolean
                                                   Dim v As vector(Of Byte()) = Nothing
                                                   Return i.to_vector_bytes(v) AndAlso
                                                          v.vector_bytes_bytes_ref(o)
                                               End Function,
                                               Function(i As vector(Of T), o() As Byte) As Boolean
                                                   Dim v As vector(Of Byte()) = Nothing
                                                   Return i.to_vector_bytes(v) AndAlso
                                                          v.vector_bytes_bytes_val(o)
                                               End Function,
                                               Function(i As vector(Of T),
                                                        o() As Byte,
                                                        ByRef offset As UInt32) As Boolean
                                                   Dim v As vector(Of Byte()) = Nothing
                                                   Return i.to_vector_bytes(v) AndAlso
                                                          v.vector_bytes_bytes_val(o, offset)
                                               End Function)
    End Sub

    Public Sub bind_default_bytes_conversion()
        bind_bytes_conversion(Of SByte)(AddressOf _bytes_others.to_sbyte,
                                        Function(i() As Byte, ByRef o As SByte) As Boolean
                                            Return entire_bytes_sbyte(i, o)
                                        End Function,
                                        Function(i() As Byte, ByRef o As SByte, ByRef offset As UInt32) As Boolean
                                            Return bytes_sbyte(i, o, offset)
                                        End Function,
                                        AddressOf _others_bytes.to_bytes,
                                        Function(i As SByte, ByRef o() As Byte) As Boolean
                                            Return eva(o, sbyte_bytes(i))
                                        End Function,
                                        Function(i As SByte, o() As Byte) As Boolean
                                            Return sbyte_bytes(i, o)
                                        End Function,
                                        Function(i As SByte, o() As Byte, ByRef offset As UInt32) As Boolean
                                            Return sbyte_bytes(i, o, offset)
                                        End Function)
        bind_bytes_conversion(Of Byte)(AddressOf _bytes_others.to_byte,
                                       Function(i() As Byte, ByRef o As Byte) As Boolean
                                           Return entire_bytes_byte(i, o)
                                       End Function,
                                       Function(i() As Byte, ByRef o As Byte, ByRef offset As UInt32) As Boolean
                                           Return bytes_byte(i, o, offset)
                                       End Function,
                                       AddressOf _others_bytes.to_bytes,
                                       Function(i As Byte, ByRef o() As Byte) As Boolean
                                           Return eva(o, byte_bytes(i))
                                       End Function,
                                       Function(i As Byte, o() As Byte) As Boolean
                                           Return byte_bytes(i, o)
                                       End Function,
                                       Function(i As Byte, o() As Byte, ByRef offset As UInt32) As Boolean
                                           Return byte_bytes(i, o, offset)
                                       End Function)
        bind_bytes_conversion(Of Int16)(AddressOf _bytes_others.to_int16,
                                        Function(i() As Byte, ByRef o As Int16) As Boolean
                                            Return entire_bytes_int16(i, o)
                                        End Function,
                                        Function(i() As Byte, ByRef o As Int16, ByRef offset As UInt32) As Boolean
                                            Return bytes_int16(i, o, offset)
                                        End Function,
                                        AddressOf _others_bytes.to_bytes,
                                        Function(i As Int16, ByRef o() As Byte) As Boolean
                                            Return eva(o, int16_bytes(i))
                                        End Function,
                                        Function(i As Int16, o() As Byte) As Boolean
                                            Return int16_bytes(i, o)
                                        End Function,
                                        Function(i As Int16, o() As Byte, ByRef offset As UInt32) As Boolean
                                            Return int16_bytes(i, o, offset)
                                        End Function)
        bind_bytes_conversion(Of UInt16)(AddressOf _bytes_others.to_uint16,
                                         Function(i() As Byte, ByRef o As UInt16) As Boolean
                                             Return entire_bytes_uint16(i, o)
                                         End Function,
                                         Function(i() As Byte, ByRef o As UInt16, ByRef offset As UInt32) As Boolean
                                             Return bytes_uint16(i, o, offset)
                                         End Function,
                                         AddressOf _others_bytes.to_bytes,
                                         Function(i As UInt16, ByRef o() As Byte) As Boolean
                                             Return eva(o, uint16_bytes(i))
                                         End Function,
                                         Function(i As UInt16, o() As Byte) As Boolean
                                             Return uint16_bytes(i, o)
                                         End Function,
                                         Function(i As UInt16, o() As Byte, ByRef offset As UInt32) As Boolean
                                             Return uint16_bytes(i, o, offset)
                                         End Function)
        bind_bytes_conversion(Of Int32)(AddressOf _bytes_others.to_int32,
                                        Function(i() As Byte, ByRef o As Int32) As Boolean
                                            Return entire_bytes_int32(i, o)
                                        End Function,
                                        Function(i() As Byte, ByRef o As Int32, ByRef offset As UInt32) As Boolean
                                            Return bytes_int32(i, o, offset)
                                        End Function,
                                        AddressOf _others_bytes.to_bytes,
                                        Function(i As Int32, ByRef o() As Byte) As Boolean
                                            Return eva(o, int32_bytes(i))
                                        End Function,
                                        Function(i As Int32, o() As Byte) As Boolean
                                            Return int32_bytes(i, o)
                                        End Function,
                                        Function(i As Int32, o() As Byte, ByRef offset As UInt32) As Boolean
                                            Return int32_bytes(i, o, offset)
                                        End Function)
        bind_bytes_conversion(Of UInt32)(AddressOf _bytes_others.to_uint32,
                                         Function(i() As Byte, ByRef o As UInt32) As Boolean
                                             Return entire_bytes_uint32(i, o)
                                         End Function,
                                         Function(i() As Byte, ByRef o As UInt32, ByRef offset As UInt32) As Boolean
                                             Return bytes_uint32(i, o, offset)
                                         End Function,
                                         AddressOf _others_bytes.to_bytes,
                                         Function(i As UInt32, ByRef o() As Byte) As Boolean
                                             Return eva(o, uint32_bytes(i))
                                         End Function,
                                         Function(i As UInt32, o() As Byte) As Boolean
                                             Return uint32_bytes(i, o)
                                         End Function,
                                         Function(i As UInt32, o() As Byte, ByRef offset As UInt32) As Boolean
                                             Return uint32_bytes(i, o, offset)
                                         End Function)
        bind_bytes_conversion(Of Int64)(AddressOf _bytes_others.to_int64,
                                        Function(i() As Byte, ByRef o As Int64) As Boolean
                                            Return entire_bytes_int64(i, o)
                                        End Function,
                                        Function(i() As Byte, ByRef o As Int64, ByRef offset As UInt32) As Boolean
                                            Return bytes_int64(i, o, offset)
                                        End Function,
                                        AddressOf _others_bytes.to_bytes,
                                        Function(i As Int64, ByRef o() As Byte) As Boolean
                                            Return eva(o, int64_bytes(i))
                                        End Function,
                                        Function(i As Int64, o() As Byte) As Boolean
                                            Return int64_bytes(i, o)
                                        End Function,
                                        Function(i As Int64, o() As Byte, ByRef offset As UInt32) As Boolean
                                            Return int64_bytes(i, o, offset)
                                        End Function)
        bind_bytes_conversion(Of UInt64)(AddressOf _bytes_others.to_uint64,
                                         Function(i() As Byte, ByRef o As UInt64) As Boolean
                                             Return entire_bytes_uint64(i, o)
                                         End Function,
                                         Function(i() As Byte, ByRef o As UInt64, ByRef offset As UInt32) As Boolean
                                             Return bytes_uint64(i, o, offset)
                                         End Function,
                                         AddressOf _others_bytes.to_bytes,
                                         Function(i As UInt64, ByRef o() As Byte) As Boolean
                                             Return eva(o, uint64_bytes(i))
                                         End Function,
                                         Function(i As UInt64, o() As Byte) As Boolean
                                             Return uint64_bytes(i, o)
                                         End Function,
                                         Function(i As UInt64, o() As Byte, ByRef offset As UInt32) As Boolean
                                             Return uint64_bytes(i, o, offset)
                                         End Function)
        bind_bytes_conversion(Of String)(AddressOf _bytes_others.to_string,
                                         Function(i() As Byte, ByRef o As String) As Boolean
                                             o = bytes_str(i)
                                             Return True
                                         End Function,
                                         Function(i() As Byte, ByRef o As String, ByRef offset As UInt32) As Boolean
                                             o = bytes_str(i, offset)
                                             offset = array_size(i)
                                             Return True
                                         End Function,
                                         AddressOf _string_others.to_bytes,
                                         Function(i As String, ByRef o() As Byte) As Boolean
                                             Return eva(o, str_bytes(i))
                                         End Function,
                                         Function(i As String, o() As Byte) As Boolean
                                             Return str_bytes(i, o)
                                         End Function,
                                         Function(i As String, o() As Byte, ByRef offset As UInt32) As Boolean
                                             Dim v As UInt32 = 0
                                             Return eva(v, offset) AndAlso
                                                    str_bytes(i, o, v) AndAlso
                                                    eva(offset, v)
                                         End Function)
        bind_bytes_conversion(Of Single)(AddressOf _bytes_others.to_single,
                                         Function(i() As Byte, ByRef o As Single) As Boolean
                                             Return entire_bytes_single(i, o)
                                         End Function,
                                         Function(i() As Byte, ByRef o As Single, ByRef offset As UInt32) As Boolean
                                             Return bytes_single(i, o, offset)
                                         End Function,
                                         AddressOf _others_bytes.to_bytes,
                                         Function(i As Single, ByRef o() As Byte) As Boolean
                                             Return eva(o, single_bytes(i))
                                         End Function,
                                         Function(i As Single, o() As Byte) As Boolean
                                             Return single_bytes(i, o)
                                         End Function,
                                         Function(i As Single, o() As Byte, ByRef offset As UInt32) As Boolean
                                             Return single_bytes(i, o, offset)
                                         End Function)
        bind_bytes_conversion(Of Double)(AddressOf _bytes_others.to_double,
                                         Function(i() As Byte, ByRef o As Double) As Boolean
                                             Return entire_bytes_double(i, o)
                                         End Function,
                                         Function(i() As Byte, ByRef o As Double, ByRef offset As UInt32) As Boolean
                                             Return bytes_double(i, o, offset)
                                         End Function,
                                         AddressOf _others_bytes.to_bytes,
                                         Function(i As Double, ByRef o() As Byte) As Boolean
                                             Return eva(o, double_bytes(i))
                                         End Function,
                                         Function(i As Double, o() As Byte) As Boolean
                                             Return double_bytes(i, o)
                                         End Function,
                                         Function(i As Double, o() As Byte, ByRef offset As UInt32) As Boolean
                                             Return double_bytes(i, o, offset)
                                         End Function)
        bind_bytes_conversion(Of Byte())(AddressOf _bytes_others.to_bytes,
                                         Function(i() As Byte, ByRef o As Byte()) As Boolean
                                             Return bytes_bytes_ref(i, o)
                                         End Function,
                                         Function(i() As Byte, ByRef o As Byte(), ByRef offset As UInt32) As Boolean
                                             Return bytes_bytes_ref(i, o, offset)
                                         End Function,
                                         AddressOf _bytes_others.to_bytes,
                                         Function(i As Byte(), ByRef o() As Byte) As Boolean
                                             Return bytes_bytes_ref(i, o)
                                         End Function,
                                         Function(i As Byte(), o() As Byte) As Boolean
                                             Return bytes_bytes_val(i, o)
                                         End Function,
                                         Function(i As Byte(), o() As Byte, ByRef offset As UInt32) As Boolean
                                             Return bytes_bytes_val(i, o, offset)
                                         End Function)
        bind_bytes_conversion(Of Boolean)(AddressOf _bytes_others.to_bool,
                                          Function(i() As Byte, ByRef o As Boolean) As Boolean
                                              Return entire_bytes_bool(i, o)
                                          End Function,
                                          Function(i() As Byte, ByRef o As Boolean, ByRef offset As UInt32) As Boolean
                                              Return bytes_bool(i, o, offset)
                                          End Function,
                                          AddressOf _others_bytes.to_bytes,
                                          Function(i As Boolean, ByRef o() As Byte) As Boolean
                                              Return eva(o, bool_bytes(i))
                                          End Function,
                                          Function(i As Boolean, o() As Byte) As Boolean
                                              Return bool_bytes(i, o)
                                          End Function,
                                          Function(i As Boolean, o() As Byte, ByRef offset As UInt32) As Boolean
                                              Return bool_bytes(i, o, offset)
                                          End Function)
        bind_bytes_conversion(Of Char)(AddressOf _bytes_others.to_char,
                                       Function(i() As Byte, ByRef o As Char) As Boolean
                                           Return entire_bytes_char(i, o)
                                       End Function,
                                       Function(i() As Byte, ByRef o As Char, ByRef offset As UInt32) As Boolean
                                           Return bytes_char(i, o, offset)
                                       End Function,
                                       AddressOf _others_bytes.to_bytes,
                                       Function(i As Char, ByRef o() As Byte) As Boolean
                                           Return eva(o, char_bytes(i))
                                       End Function,
                                       Function(i As Char, o() As Byte) As Boolean
                                           Return char_bytes(i, o)
                                       End Function,
                                       Function(i As Char, o() As Byte, ByRef offset As UInt32) As Boolean
                                           Return char_bytes(i, o, offset)
                                       End Function)
        bind_bytes_conversion(Of vector(Of Byte()))(AddressOf _bytes_array.to_vector_bytes,
                                                    Function(i() As Byte, ByRef o As vector(Of Byte())) As Boolean
                                                        Return _bytes_array.entire_bytes_vector_bytes(i, o)
                                                    End Function,
                                                    Function(i() As Byte,
                                                             ByRef o As vector(Of Byte()),
                                                             ByRef offset As UInt32) As Boolean
                                                        Return _bytes_array.bytes_vector_bytes(i, o, offset)
                                                    End Function,
                                                    AddressOf _bytes_array.to_bytes,
                                                    Function(i As vector(Of Byte()), ByRef o() As Byte) As Boolean
                                                        Return _bytes_array.vector_bytes_bytes_ref(i, o)
                                                    End Function,
                                                    Function(i As vector(Of Byte()), o() As Byte) As Boolean
                                                        Return _bytes_array.vector_bytes_bytes_val(i, o)
                                                    End Function,
                                                    Function(i As vector(Of Byte()),
                                                             o() As Byte,
                                                             ByRef offset As UInt32) As Boolean
                                                        Return _bytes_array.vector_bytes_bytes_val(i, o, offset)
                                                    End Function)
        bind_bytes_vector_T_conversion(Of SByte)()
        bind_bytes_vector_T_conversion(Of Byte)()
        bind_bytes_vector_T_conversion(Of Int16)()
        bind_bytes_vector_T_conversion(Of UInt16)()
        bind_bytes_vector_T_conversion(Of Int32)()
        bind_bytes_vector_T_conversion(Of UInt32)()
        bind_bytes_vector_T_conversion(Of Int64)()
        bind_bytes_vector_T_conversion(Of UInt64)()
        bind_bytes_vector_T_conversion(Of String)()
        bind_bytes_vector_T_conversion(Of Single)()
        bind_bytes_vector_T_conversion(Of Double)()
        bind_bytes_vector_T_conversion(Of Boolean)()
        bind_bytes_vector_T_conversion(Of Char)()

        npos_uint_bytes_binder.bind_npos_uint()
        npos_uint_bytes_binder.bind_npos_uint32()
        npos_uint_bytes_binder.bind_npos_uint64()
        npos_uint_bytes_binder.bind_positive_npos_uint()
        npos_uint_bytes_binder.bind_positive_npos_uint32()
        npos_uint_bytes_binder.bind_positive_npos_uint64()
        npos_uint_bytes_binder.bind_positive_size_t()
        npos_uint_bytes_binder.bind_positive_size_t_32()
        npos_uint_bytes_binder.bind_positive_size_t_64()
        npos_uint_bytes_binder.bind_retry_times_t()
        npos_uint_bytes_binder.bind_size_t()
        npos_uint_bytes_binder.bind_size_t_32()
        npos_uint_bytes_binder.bind_size_t_64()
        npos_uint_bytes_binder.bind_timeout_ms_t()
    End Sub
End Module
